{% load bootstrap3 %}

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE-edge">
    <meta name="viewport" content="width-device-width, initial-scale=1">

    <title>Learning Log</title>

    {% bootstrap_css %}
    {% bootstrap_javascript %}
</head>
<body>
    <!-- Static navbar -->
    <nav class="navbar navbar-default navbar-static-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed"
                data-toggle="collapse" data-target="#navbar"
                aria-expanded="false" aria-controls="navbar">
                </button>
                <a class="navbar-brand" href="{% url 'learning_logs:index' %}">Learning Log
                </a>
            </div>
            <div id="navbar" class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li><a href="{% url 'learning_logs:topics' %}">Topics</a></li>
                </ul>

                <ul class="nav navbar-nav navbar-right">
                    {% if user.isauthenticated %}
                        <li><a>Hello,{{ user.username }}.</a></li>
                        <li><a href="{% url 'users:logout' %}">log out</a></li>
                    {% else %}
                        <li><a href="{% url 'users:register' %}">register</a> </li>
                        <li><a href="{% url 'users:login' %}">log in</a></li>
                    {% endif %}
                </ul>
            </div><!--/.nav-collapse -->
        </div>
    </nav>

    <div class="container">
        <div class="page-header">
            {% block header %}{% endblock header %}
        </div>
        <div>
            {% block content %}{% endblock content %}
        </div>
    </div><!-- /container -->
</body>
</html>

{#{% load bootstrap3 %}  {# 加载 Bootstrap 标签库 #}
{#<!DOCTYPE html>#}
{#<html lang="zh-CN">#}
{#<head>#}
{#    <meta charset="UTF-8">#}
{#    <title>Learning Log</title>#}
{#    {% bootstrap_css %}  {# 引入 Bootstrap 的 CSS 文件 #}
{#    {% bootstrap_javascript %}  {# 引入 Bootstrap 的 JS 文件（含依赖的 jQuery） #}
{#</head>#}
{#<body>#}
{#    <!-- 导航栏示例（对应图里的顶部导航） -->#}
{#    <nav class="navbar navbar-default">#}
{#        <div class="container-fluid">#}
{#            <div class="navbar-header">#}
{#                <a class="navbar-brand" href="{% url 'learning_logs:index' %}">Learning Log</a>#}
{#            </div>#}
{#            <div>#}
{#                <ul class="nav navbar-nav">#}
{#                    <li><a href="{% url 'learning_logs:topics' %}">Topics</a></li>#}
{#                </ul>#}
{#                <ul class="nav navbar-nav navbar-right">#}
{#                    <li><a href="{% url 'users:register' %}">register</a></li>#}
{#                    <li><a href="{% url 'users:login' %}">log in</a></li>#}
{#                </ul>#}
{#            </div>#}
{#        </div>#}
{#    </nav>#}
{##}
{#    <div class="container">  {# Bootstrap 容器，让内容居中并限制宽度 #}
{#        {% block content %}{% endblock content %}  {# 子模板继承的内容块 #}
{#    </div>#}
{#</body>#}
{#</html>#}